package common.itemhandling.files;

public class Version implements Comparable {
	private int firstLevel;

	private int secondLevel;

	private int thirdLevel;

	public int getFirstLevel() {
		return firstLevel;
	}

	private void setFirstLevel(int firstLevel) {
		this.firstLevel = firstLevel;
	}

	public int getSecondLevel() {
		return secondLevel;
	}

	private void setSecondLevel(int secondLevel) {
		this.secondLevel = secondLevel;
	}

	public int getThirdLevel() {
		return thirdLevel;
	}

	private void setThirdLevel(int thirdLevel) {
		this.thirdLevel = thirdLevel;
	}

	public void upgrade() {
		setFirstLevel(getFirstLevel() + 1);
	}

	public void minorUpdate() {
		setThirdLevel(getThirdLevel() + 1);
	}

	public void majorUpdate() {
		setSecondLevel(getSecondLevel() + 1);
	}

	public String toString() {
		return firstLevel + "." + secondLevel + "." + thirdLevel;
	}

	public int compareTo(Object o) {
		Version v = (Version) o;
		return this.toString().compareTo(v.toString());
	}

}
